package com.hbnu.service;

import com.hbnu.dao.UserDao2;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional // 开启事务
public class UserService2 {
    @Resource(name = "userDao2")
    private UserDao2 userDao2;

    public void setUserDao2(UserDao2 userDao2) {
        this.userDao2 = userDao2;
    }

    public void addUser() {
        userDao2.addUser();
    }

    public void account() {
        userDao2.transfer();


        userDao2.receive();
    }


}
